<%@ include file="/WEB-INF/views/public/include.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<!-- 页面编码 -->
	<meta charset="utf-8">
	<!-- 手机浏览器禁止缩放, 页面大小默认为手机屏幕宽度 -->
	<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
	<!-- 允许IOS全屏显示网页 -->
	<meta content="yes" name="apple-mobile-web-app-capable" />
	<!-- 设置IOS状态栏为透明底色 -->
	<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
	<!-- 设置360浏览器渲染引擎为webkit -->
	<meta name="renderer" content="webkit">
	<!-- 设置APP标题 -->
	<meta name="apple-mobile-web-app-title" content="青年电影志">
	<!-- 关闭自动识别电话号码 -->
	<meta name="format-detection" content="telephone=no">
	<!-- iPhone桌面图标 -->
	<link href="/resources/static/images/app-60@2x.png" sizes="120x120" rel="apple-touch-icon-precomposed">
	<!-- 页面标题 -->
	<title>被约申请</title>

	<!-- 基本样式载入 -->
	<link rel="stylesheet" href="/resources/static/css/ionicons.min.css">
	<link rel="stylesheet" href="/resources/static/css/public.css?m=1234">
	<!-- 基本脚本载入 -->
	<script src="/resources/static/js/plugins.min.js"></script>
</head>
<body>
<div id="app" class="site" data-controller="dashPage">
	<div class="bar bar-footer bar-primary">
		<nav class="bar-navigation">
			<a class="menu-item" href="/main/index">
				<i class="menu-icon ico-home"></i>
				<span class="menu-label">首页</span>
			</a>
			<a class="menu-item" href="/main/discovery">
				<i class="menu-icon ico-discovery"></i>
				<span class="menu-label">发现</span>
			</a>
			<a class="menu-item is-active" href="/main/user/index">
				<i class="menu-icon ico-me"></i>
				<span class="menu-label">我的</span>
			</a>
		</nav>
		<!-- END .bar-navigation -->
	</div>
	<div id="content" class="site-content">
		<div class="inner">
			<div class="nav-group" role="group">
				<a href="?status=0" <c:if test="${status == 0}">class="is-active"</c:if> >进行中</a>
				<a href="?status=1" <c:if test="${status == 1}">class="is-active"</c:if> >待评价</a>
				<a href="?status=2" <c:if test="${status == 2}">class="is-active"</c:if> >已结束</a>
			</div>

			<c:forEach var="application" items="${applications}">
				<article class="order-view">
					<div class="order-content">
						<div class="people-avatar">
							<img src="${application.user.picUrl}" alt="">
							<span class="people-name">${application.user.getName()}</span>
						</div>
						<!-- END .people-avatar -->
						<div class="people-content">
							<div class="top-meta">
								<span class="pull-left">青年电影志话题</span>
								<span class="pull-right">${application.price} 元/小时</span>
							</div>
							<h3 class="people-title">${application.subjectTitle}</h3>
							<!--<span class="people-pos">${application.user.profession}</span>-->
						</div>
						<!-- END .people-content -->
						<a href="./tome/single?applicationId=${application.id}" class="overlay-link"></a>
					</div>
					<!-- END .order-content -->
					<div class="order-meta">
						<c:choose>
							<c:when test="${application.status == 1}">
								<div class="pull-left">订单状态:<span class="state-success">待处理</span></div>
								<div class="pull-right clearfix">
									<a href="./tome/single?applicationId=${application.id}" class="state-primary">查看详情</a>
									<a href="./tome/handle?applicationId=${application.id}&status=1" class="state-primary">同意约见</a>
									<a href="./tome/handle?applicationId=${application.id}&status=-1" class="state-danger">拒绝约见</a>
								</div>
							</c:when>


							<c:when test="${application.status == 2}">
								<c:choose>
									<c:when test="${application.starComment}">
										<div class="pull-left">订单状态:<span class="state-success">同意申请，待评价</span></div>
										<div class="pull-right clearfix">
											<a href="./tome/single?applicationId=${application.id}" class="state-primary">查看详情</a>
											<a href="#" class="state-info">已经评价，待对方评价</a>
										</div>
									</c:when>

									<c:when test="${!application.starComment}">
										<div class="pull-left">订单状态:<span class="state-success">同意申请，待评价</span></div>
										<div class="pull-right clearfix">
											<a href="./tome/single?applicationId=${application.id}" class="state-primary">查看详情</a>
											<a href="./tome/comment?applicationId=${application.id}" class="state-info">评价</a>
										</div>
									</c:when>
									<c:otherwise></c:otherwise>
								</c:choose>
							</c:when>


							<c:when test="${application.status == -1 || application.status == -2}">
								<div class="pull-left">订单状态:<span class="state-success">已拒绝</span></div>
								<div class="pull-right clearfix">
									<a href="./tome/single?applicationId=${application.id}" class="state-primary">查看详情</a>
								</div>
							</c:when>
							<c:when test="${application.status == 3}">
								<div class="pull-left">订单状态:<span class="state-success">已评价</span></div>
								<div class="pull-right clearfix">
									<a href="./tome/single?applicationId=${application.id}" class="state-primary">查看详情</a>
								</div>
							</c:when>
							<c:when test="${application.status == 4}">
								<div class="pull-left">订单状态:<span class="state-success">已收款</span></div>
								<div class="pull-right clearfix">
									<a href="./tome/single?applicationId=${application.id}" class="state-primary">查看详情</a>
								</div>
							</c:when>

							<c:otherwise></c:otherwise>
						</c:choose>

					</div>
				</article>
			</c:forEach>
			<c:if test="${applications == null || applications.size() == 0}">
				<div class="no-yuejian">
					<i class="ion-coffee"></i>
					<p>你没有进行中的约见哦<br>快去预约你感兴趣的话题吧</p>
					<a href="/main/discovery" class="hang-link">随便看看</a>
				</div>
			</c:if>
		</div>
		<!-- END .inner -->
	</div>
	<!-- END #content -->
</div>
<!-- END #page -->
<!-- 页面脚本载入 -->
<script src="/resources/static/js/app.js"></script>
</body>
</html>